﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Data;

namespace KZ.Express.H
{
    public class Global
    {

        public static void GenerateNumber(ref DataTable table)
        {
            int count = table.Rows.Count;
            for (int i = 0; i < count; i++)
                table.Rows[i]["Number"] = i + 1;
        }

        public static void SetDoubleBuffered(Control control)
        {
            // set instance non-public property with name "DoubleBuffered" to true
            typeof(Control).InvokeMember("DoubleBuffered",
                BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic,
                null, control, new object[] { true });
        }
    }
}
